package com.example.myapplication.mroom.database;

import com.example.myapplication.mroom.pojo.UserRoom;

import java.util.List;

import androidx.room.Dao;
import androidx.room.Delete;
import androidx.room.Insert;
import androidx.room.Query;
import androidx.room.Update;

@Dao
public interface UserRoomDao {
    @Insert
    void insert(List<UserRoom> userRooms);

    @Insert
    void insert(UserRoom userRoom);

    @Query("select * from user_room")
    List<UserRoom> queryAll();

    @Update
    void upData(UserRoom...userRoom);

    @Query("select * from user_room where id = :aid")
    UserRoom queryById(int aid);

    @Query("delete from user_room")
    void deleteTable();

    @Delete
    void delete(UserRoom userRoom);
}
